package com.nai365.nart.order.feign;

import com.nai365.nart.common.core.constant.SecurityConstants;
import com.nai365.nart.common.core.constant.ServiceNameConstants;
import com.nai365.nart.common.core.util.R;
import com.nai365.nart.order.to.WareSkuLockTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 库存系统
 */
@FeignClient(ServiceNameConstants.WARE_SERVICE)
public interface WmsFeignService {

    /**
     * 批量查询sku是否有库存
     */
    @PostMapping(value = "/waresku/hasstock")
    R getSkuHasStock(@RequestBody List<Long> skuIds, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 查询运费和收货地址信息
     */
    @GetMapping(value = "/wareinfo/fare")
	R getFare(@RequestParam("addrId") Long addrId, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 锁定库存
     */
    @PostMapping(value = "/waresku/lock/order")
    R orderLockStock(@RequestBody WareSkuLockTO vo, @RequestHeader(SecurityConstants.FROM) String from);
}
